<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <base href="<%= basePath %>"/>
    <title>Insert title here</title>

    <base href="<%= basePath %>"/>
    <title>用户登录</title>
    <style>
        body {
            background: #f5f6fa;
            font-family: 'Segoe UI', 'Arial', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .login-container {
            background: #fff;
            padding: 32px 40px;
            border-radius: 12px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.08);
            min-width: 320px;
        }
        h1 {
            text-align: center;
            color: #222;
            margin-bottom: 24px;
            font-size: 2rem;
        }
        label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-size: 1rem;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 10px 12px;
            margin-bottom: 18px;
            border: 1px solid #dcdde1;
            border-radius: 6px;
            font-size: 1rem;
            background: #f9f9f9;
            transition: border 0.2s;
        }
        input[type="text"]:focus, input[type="password"]:focus {
            border: 1.5px solid #4f8cff;
            outline: none;
        }
        input[type="submit"] {
            width: 100%;
            padding: 10px 0;
            background: #4f8cff;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: background 0.2s;
        }

        input[type="submit"]:hover {
            background: #357ae8;
        }


        input[type="button"] {
            width: 100%;
            padding: 10px 0;
            background: #4f8cff;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: background 0.2s;
        }

        input[type="button"]:hover {
            background: #357ae8;
        }

    </style>

</head>
<body>
<div class="login-container">
    <h1>登录界面</h1>
    <form action="LoginServlet" method="post">
        <label for="username">用户名：</label>
        <input type="text" id="username" name="username" required>
        <label for="password">用户密码：</label>
        <input type="password" id="password" name="password" required>
        <input type="submit" value="登录">
        <div style="height: 10px"></div>
        <input type="button" value="用户注册" onclick="window.location.href='pages/register.jsp'">
        <div style="height: 10px"></div>
        <input type="submit" value="用户首页" onclick="window.location.href='UserIndexServlet'">
    </form>
</div>

</body>
</html>